<?php // no direct access
defined('_JEXEC') or die('Restricted access');
/*$document	=& JFactory::getDocument();
$js= "components/com_jbschedule/js/prototype.js";
$document->addScript(JURI::base().$js);*/
?>

<form action="index.php" method="post" name="adminForm">
<div id="editcell">
	<table class="adminform">
		<tr>
			<td width="100%">
				<?php echo JText::_( 'SEARCH' );?>
				<input type="text" name="search" id="search" value="<?php echo $this->lists['search']; ?>" class="text_area" onChange="document.adminForm.submit();" />
				<button onclick="this.form.submit();"><?php echo JText::_( 'Go' ); ?></button>
				<button onclick="this.form.getElementById('search').value='';this.form.submit();"><?php echo JText::_( 'Reset' ); ?></button>
			</td>
		</tr>
	</table>
	<table class="adminlist">
	<thead>
		<tr>
			<th width="5">
				<?php echo JText::_( 'ID' ); ?>
			</th>
			<th width="20">
				<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $this->items ); ?>);" />
			</th>
			<th>
				<?php echo JHTML::_('grid.sort', 'NAME', 'u.name', $this->lists['order_Dir'], $this->lists['order'] ); ?>
			</th>
			<th>
				<?php echo JHTML::_('grid.sort', 'USERNAME', 'u.username', $this->lists['order_Dir'], $this->lists['order'] ); ?>
			</th>
			<th>
				<?php echo JText::_( 'EMAIL' ); ?>
			</th>
			<th>
				<?php echo JText::_( 'JOOMLA USER TYPE' ); ?>
			</th>
			<th>
				<?php echo JHTML::_('grid.sort', 'JBS ROLE', 'tsb_role', $this->lists['order_Dir'], $this->lists['order'] ); ?>
			</th>
		</tr>
	</thead>
	<tfoot>
		<tr>
			<td colspan="7">
				<?php echo $this->pageNav->getListFooter(); ?>
			</td>
		</tr>
	</tfoot>
	<tbody>
	<?php
	$k = 0;
	for ($i=0, $n=count( $this->items ); $i < $n; $i++)
	{
		$row = &$this->items[$i];
		$checked 	= JHTML::_('grid.id',   $i, $row->id );
		$link 		= JRoute::_( 'index.php?option=com_jbschedule&controller=users&task=edit&cid[]='. $row->id );

		?>
		<tr class="<?php echo "row$k"; ?>">
			<td>
				<?php echo $row->id; ?>
			</td>
			<td>
				<?php echo $checked; ?>
			</td>
			<td>
				<a href="<?php echo $link; ?>"><?php echo $row->name; ?></a>
			</td>
			<td>
				<a href="<?php echo $link; ?>"><?php echo $row->username; ?></a>
			</td>
			<td>
				<a href="mailto:<?php echo $row->email; ?>" title="<?=(JText::_('Send email to ').$row->email)?>"><?php echo $row->email; ?></a>
			</td>
			<td>
				<?php echo $row->usertype; ?>
			</td>
			<td>
				<a href="<?php echo "index.php?option=com_jbschedule&controller=roles&task=edit&cid[]=".$row->tsb_role_id; ?>" title="<?=JText::_('Edit this Role')?>">
				<?php echo $row->tsb_role; ?>
				</a>
			</td>
		</tr>
		<?php
		$k = 1 - $k;
	}
	?>
	</tbody>
	</table>
</div>

<input type="hidden" name="option" value="com_jbschedule" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="view" value="users" />
<input type="hidden" name="controller" value="users" />
<input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
<input type="hidden" name="filter_order_Dir" value="" />
</form>